package com.javabi.htmlbuilder.css.declaration;

import com.javabi.htmlbuilder.css.CSSBuilder;
import com.javabi.htmlbuilder.css.CSSDeclaration;
import com.javabi.htmlbuilder.css.CSSPropertyName;

/**
 * A CSS Cursor.
 */
public enum Cursor implements CSSDeclaration {

	/** The auto cursor. */
	AUTO("auto"),
	/** The crosshair cursor. */
	CROSSHAIR("crosshair"),
	/** The default cursor. */
	DEFAULT("default"),
	/** The pointer cursor. */
	POINTER("pointer"),
	/** The move cursor. */
	MOVE("move"),
	/** The e-resize cursor. */
	E_RESIZE("e-resize"),
	/** The ne-resize cursor. */
	NE_RESIZE("ne-resize"),
	/** The nw-resize cursor. */
	NW_RESIZE("nw-resize"),
	/** The n-resize cursor. */
	N_RESIZE("n-resize"),
	/** The se-resize cursor. */
	SE_RESIZE("se-resize"),
	/** The sw-resize cursor. */
	SW_RESIZE("sw-resize"),
	/** The s-resize cursor. */
	S_RESIZE("s-resize"),
	/** The w-resize cursor. */
	W_RESIZE("w-resize"),
	/** The text cursor. */
	TEXT("text"),
	/** The wait cursor. */
	WAIT("wait"),
	/** The help cursor. */
	HELP("help");

	/** The value. */
	private final String value;

	/**
	 * Creates a new declaration.
	 * @param value the value.
	 */
	private Cursor(String value) {
		this.value = value;
	}

	/**
	 * Returns the value.
	 * @return the value.
	 */
	public String getValue() {
		return value;
	}

	/**
	 * Returns the property.
	 * @return the property.
	 */
	public CSSPropertyName getPropertyName() {
		return CSSPropertyName.CURSOR;
	}

	/**
	 * Append this to the given css builder.
	 * @param css the css builder.
	 * @return the css builder.
	 */
	public CSSBuilder appendTo(CSSBuilder css) {
		return css.property(getPropertyName(), getValue());
	}

}
